

export default function () {
  /*
  公众号产品介绍: https://mp.weixin.qq.com/mp/appmsgalbum?__biz=Mzg3ODkwMjQ1Mg==&action=getalbum&album_id=2974910201281921025#wechat_redirect
  */
  const list = ref([
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/1.jpg',
      type: 'image',
      title: '18导心电图机e1800plus',
      type: 4,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247488784&idx=1&sn=6282e48fe442a003ed0c54cd0c18e8c1&chksm=cf0df8cbf87a71dd57f6b2c0fb44f7bd1cab6d5b6234a18554bd38dc2b78aaef3bfd98396739&token=1930050232&lang=zh_CN#rd',
    },
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/2.jpg',
      type: 'image',
      title: '动态心电i12plus',
      type: 2,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247488791&idx=1&sn=2ac8ae6b1e9af79bf302f9d76e375df5&chksm=cf0df8ccf87a71da660fc93321f989fa26a934ecf14bf69ff5010c3f41751159f54b7add9978&token=1930050232&lang=zh_CN#rd',
    },
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/3.jpg',
      type: 'image',
      title: '实时动态心电G12plus',
      type: 1,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247488807&idx=1&sn=7e81e4be7e8a39a54c04ee10ae1f7afb&chksm=cf0df8fcf87a71eaf9c7109519b396ccdce5f5104cbe1103690c347133b385f71c5ce21c482e&token=1930050232&lang=zh_CN#rd',
    },
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/4.jpg',
      type: 'image',
      title: '心电工作站ePCECG-12a',
      type: 5,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247488818&idx=1&sn=c9940ef3ed6e5141386846ce47304ce9&chksm=cf0df8e9f87a71ff0ed4e0397704e94e4493846653299ca188322db8f254aadbd1e360e3fedf&token=1930050232&lang=zh_CN#rd',
    },
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/5.jpg',
      type: 'image',
      title: '心电工作站系列',
      type: 5,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247488838&idx=1&sn=26b1e5ff359dce1f3240dba3a29379d3&chksm=cf0df89df87a718bfb33c5e5a12eb49652b0492cd7c37228955ee5705f3e18bd2c147c40db07&token=1930050232&lang=zh_CN#rd',
    },
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/6.jpg',
      type: 'image',
      title: '动态血压全系列',
      type: 3,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247488798&idx=1&sn=76f2753210f53a9b5c71e91075b309a8&chksm=cf0df8c5f87a71d3b98b0ee0df9d40150c6d4c8c365c91217bf60adb596e3e7b154ca7073092&token=1930050232&lang=zh_CN#rd',
    },
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/7.jpg',
      type: 'image',
      title: '产品手册',
      type: 0,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247488939&idx=1&sn=8092c69564cd4f8cae4f3fc9b9b80eb4&chksm=cf0df870f87a7166fe8015e15e7d7c4e0d12795182470d6df3c51df0368a8ab8b2b071aac773&token=1930050232&lang=zh_CN#rd',
    },
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/8.jpg',
      homeUrl: 'https://ai-ecg-beta.lifesense.com/resources/images/home_s.png',
      type: 'image',
      title: '智能心电衣',
      type: 1,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247490121&idx=1&sn=c1401f3311e9cce2fcff76f5fbfc6962&chksm=cf0df792f87a7e84626b1f27c7cea2feb0f64088e4a3d58a809ba84273947dd9480360ef9000&token=1930050232&lang=zh_CN#rd',
    },
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/9.jpg',
      type: 'image',
      title: '心电图机e1202',
      type: 4,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247490123&idx=1&sn=f13c94a86b32df2f6c64477654579d12&chksm=cf0df790f87a7e86bb15b76c71563074851e85c5329a6c3ff0d565fe48c5de68d7076679de9d&token=1930050232&lang=zh_CN#rd',
    },
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/10.jpg',
      type: 'image',
      title: '智能心贴Mi-Rhythm',
      type: 2,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247490125&idx=1&sn=309d7de0dc348d8be86052537789e94b&chksm=cf0df796f87a7e809ab55c0aa6208e44b203b2fa9aac6b990caef6f66461f4335495b3f9f53e&token=1930050232&lang=zh_CN#rd',
    },
    {
      url: 'https://ai-ecg-beta.lifesense.com/resources/images/11.jpg',
      type: 'image',
      title: '心电网络might-net',
      type: 0,
      pageUrl:
        'https://mp.weixin.qq.com/s?__biz=Mzg3ODkwMjQ1Mg==&mid=2247490127&idx=1&sn=de598e635e8ae007a4fed9f70557918b&chksm=cf0df794f87a7e82e5d89263b4525e7e7bcb1a3f602f446a0e75b2b8cc5db08d399ea63330d5&token=1930050232&lang=zh_CN#rd',
    },
  ])

  const homeList = () => {
    return list.value.filter((item) => item.homeUrl)
  }

  const jumpAdvertisement = (index) => {
    const pageUrl = homeList()[index].pageUrl
    uni.navigateTo({ url: `/pages-sub/advertisement/index?id=${encodeURIComponent(pageUrl)}` }, 1000)
  }

  const jumpProductDetail = (pageUrl) => {
    uni.navigateTo({ url: `/pages-sub/advertisement/index?id=${encodeURIComponent(pageUrl)}` }, 1000)
  }

  return {
    list,
    homeList,
    jumpProductDetail,
    jumpAdvertisement
  }
}
